package com.java.tutorials.jdk7.files;

import java.io.File;
import java.net.URI;
import java.nio.file.Path;
import java.nio.file.Paths;

/**
 * Created by xuzhike on 2016/1/26.
 * http://www.java2s.com/Code/Java/JDK-7/InteroperabilitybetweenjavaioFileandjavaniofileFiles.htm
 * Interoperability between java.io.File and java.nio.file.Files
 */
public class InteroperabilitybetweenjavaioFileandjavaniofileFiles {
    public static void main(String[] args) throws Exception {
        Path path = Paths.get(new URI("file:///C:/home/docs/users.txt"));
        File file = new File("C:\\home\\docs\\users.txt");
        Path toPath = file.toPath();
        System.out.println(toPath.equals(path));
    }
}
